// http请求处理工具类

/**
 * 
 * @param {*} http_message http请求消息
 * @param {*} headers_key 请求头key
 * @returns 请求头参数参数
 */
export function get_headers(http_message, headers_key) {
    if (http_message["headers"]) {
        return http_message["headers"][headers_key];
    }

}

/**
 * 
 * @param {*} http_message http请求消息
 * @returns token
 */
export function get_token(http_message) {
    if (http_message["headers"]) {
        return http_message["headers"]['authorization'];
    }
}

/**
 * 
 * @param {*} http_message http请求消息
 * @returns 账号
 */
export function check_auth(http_message) {
    let headers = http_message["headers"];
    if (headers && headers['authorization'] && _AdminTokenUserCache.has(headers['authorization'])) {
        return _jwt_.validation(headers['authorization']);
    }
    return "";
}